<?php
require('../util/DBUtil.php');
$dbServer = new swoole_server('0.0.0.0',9502);
$dbServer->on('receive',function($serv,$fd,$reactor_id,$data){
	$data = json_decode($data,1);
	$serv->send($fd,(new DBUtil)->saveToDB($data,$data['__dbname']));
});

$dbServer->start();